Repository navigation
Conversation
Text generation checked only the environment-wide enabled flag for the selected provider, so a provider a project disables still ran for that project. Check the project setting too, fall back to another eligible provider, and fail with the no-provider error when none is left.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…ject-disabled-provider
|
The automated pipeline stopped on this pull request and will not merge it: the fix is written and reviewed, but proving it needs something no worker has:
It stays open for a person to finish or close. |
|
Closing this PR for now to focus on other open fixes while under the unvouched open-PR limit. |
Problem
When a project turns off its text generation provider under the project's provider settings, T3 Code still runs that provider for the project's thread titles, commit messages, PR text, branch names and review guides. Expected: a provider the project turns off is never called for that project.
TextGeneration.generatedecided whether the selected provider could run from its snapshot's machine-wideenabledflag only. The project setting was checked only for fallback candidates. When the project turns off the only enabled provider,resolveProjectSettingshas nothing to swap in and keeps the selection, andgeneratethen runs it. The snapshot flag is also not the machine-wide setting: a snapshot stays enabled while any project turns its instance on (ProviderInstanceRegistryHydration.ts), so calls with no project relied on it too.Change
generatereads settings once for every agent-provider call and treats the selected provider as disabled when its snapshot says so orresolveProjectProviderInstanceEnabled(settings, projectId ?? null, id)is false. A disabled selection then goes through the existing fallback, which uses the same settings, and returns the existing "No text generation provider is available" error when nothing qualifies. Text generators (model APIs) return before this check and keep their own enabled setting. A failed settings read now returns a typedTextGenerationErrorinstead of calling the provider.Scope
One problem, two files (
TextGeneration.tsand its existing preflight test table). It needs no issue because it is a small fix for an obvious bug: a provider the project turned off still runs for that project.Verification
An AI agent (T3 Code Nightly) ran each check below.
apps/server/src/textGeneration/CodexTextGeneration.test.ts: three new rows in the existing preflight table:On
83119ae8bdthey fail (3 failed, 36 passed); on this branch all 39 pass.vp run check:changedpasses.To reproduce without any provider account (Linux, any checkout of this branch):
The free
Replay (dev)provider cannot generate text, so a real-app run needs a signed-in provider.Real server, Linux, real Codex CLI 0.171.0 (
gpt-6-luna), fresh isolated data for each run, freeReplay (dev)agent for the thread turn.Setup:
gpt-6-luna.Steps: start a thread in that project, send the first message, read the thread title and the server trace after the turn settles.
Before (
83119ae8bd), from the run transcript and server trace:After (this branch):
The trace has no Codex span on this branch.
Control on this branch, same setup without the project setting: Codex runs (
runCodexJson.runCodexCommand2649 ms) and the title becomes "Bearer Token Authentication Pipeline".Not shown: other agent providers. The changed check is provider-independent and runs before any provider is called.
Generated with Gemini 4 Neon in T3 Code Nightly